import mysql.connector
import json

class Toolbox(object):


    _erp_manager = None

    def manager(self):
        if self._erp_manager is None:
            self._erp_manager = mysql.connector.connect(
                user='wubuze',
                password='123456',
                database='mysite',
                auth_plugin='mysql_native_password'
            )
        return self._erp_manager

    def proceed(self, command):
        cur =  self.manager().cursor()

        cur.execute(command)
        console_result = cur.fetchall()
        # cur.close()
        # conn.close()
        result = json.loads(json.dumps(console_result))
        return  result